/** 
 *
 * Lisense:
 * Copyright (c) 2015.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 * @fileDesc:TODO
 * @author:dairymix
 * @version:1.0.0
 */
package cn.wanghaomiao.seimi.http;

import java.util.Collection;

import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecProvider;
import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.impl.cookie.BrowserCompatSpec;
import org.apache.http.impl.cookie.BrowserCompatSpecFactory.SecurityLevel;
import org.apache.http.params.HttpParams;
import org.apache.http.protocol.HttpContext;

/** 
 * @ClassName:CookieSpecProvider
 * @Description:TODO
 * @author:dairymix
 * @version:1.0.0
 */
public class SeimiCookieSpecProvider implements CookieSpecProvider{

    private final String[] datepatterns={"http.protocol.cookie-policy"};
    private final SecurityLevel securityLevel=SecurityLevel.SECURITYLEVEL_DEFAULT;

    public CookieSpec create(HttpContext context) {
        return new BrowserCompatSpec(this.datepatterns,this.securityLevel);
        //return new BrowserCompatSpec(this.datepatterns);
    }

//    public CookieSpec create(HttpContext context) {
//
//        return new BrowserCompatSpec() {
//            @Override
//            public void validate(Cookie cookie, CookieOrigin origin)
//                    throws MalformedCookieException {
//                // Oh, I am easy
//            }
//        };
//    }

}
